import React, { Component } from 'react'
import TabBar from '../common/TabBar';
import Header from '../common/Header';
import {connect} from 'react-redux';
class My extends Component {
    render() {
        return (
            <div className='my'>
                {/* 头部组件 */}
                <Header title={<h4>饿了么</h4>} right={<div><span className='iconfont icon-sangedian'></span>|<span className='iconfont icon-cha'></span></div>}></Header>
                <div className="admin">
                    <img src='/img/2.jpg' alt=""/>
                    <div className="content">
                        <h4>周国鹏</h4>
                        <p>152****1713</p>
                    </div>
                </div>
                <div className="img">
                    <img src="/img/1.jpg" alt=""/>
                </div>
                {/* 底部功能组件 */}
                <div className="black">
                    <div className="left">
                        <span className='iconfont icon-hongbao'></span>
                        <span>我的红包</span>
                    </div>
                    <div className="right">
                        <span className='col'>3个</span>
                        <span>></span>
                    </div>
                </div>
                <div className="black">
                    <div className="left">
                        <span className='iconfont icon-zonghejintie'></span>
                        <span>我的津贴</span>
                    </div>
                    <div className="right">
                        <span className='col'>￥20</span>
                        <span>></span>
                    </div>
                </div>
                <div className="black" onClick={()=>{this.props.history.push('/city')}}>
                    <div className="left" >
                        <span className='iconfont icon-dizhi'></span>
                        <span>我的地址</span>
                    </div>
                    <div className="right">
                        <span className='col'></span>
                        <span>{this.props.lis.city?<span>{this.props.lis.city}</span>:<span>还没设置默认地址</span>}></span>
                    </div>
                </div>
                <div className="black" onClick={()=>{this.props.history.push('/collent')}}>
                    <div className="left">
                        <span className='iconfont icon-shoucang'></span>
                        <span>我的收藏</span>
                    </div>
                    <div className="right">
                        <span className='col'>{this.props.list.length>0?this.props.list.length:<span>这个人很懒，还没收藏</span>}</span>
                        <span>></span>
                    </div>
                </div>
                <div className="black">
                    <div className="left">
                        <span className='iconfont icon-kefu'></span>
                        <span>我的客服</span>
                    </div>
                    <div className="right">
                        <span className='col'></span>
                        <span>></span>
                    </div>
                </div>
                <div className="black">
                    <div className="left">
                        <span className='iconfont icon-rules'></span>
                        <span>规则中心</span>
                    </div>
                    <div className="right">
                        <span className='col'></span>
                        <span>></span>
                    </div>
                </div>

                {/* 底部公共路由 */}
                <TabBar></TabBar>
            </div>
        )
    }
}
export default connect(
    (state)=>{
        return {
            list:state.collentShop,
            lis:state.myList
        }
    },
    (dispatch)=>{
        return {

        }
    }
)(My)
